﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Top.Api;
using Top.Api.Request;
using Top.Api.Response;

public partial class _Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        string url = "http://gw.api.tbsandbox.com/router/rest";//沙箱环境调用地址, 
        //正式环境需要设置为:http://gw.api.taobao.com/router/rest 
        string appkey = "test";
        string appsecret = "test";
        ITopClient myclient = new DefaultTopClient(url, appkey, appsecret);//实例化ITopClient类 
        //ItemsGetRequest itemReq = new ItemsGetRequest();
        //itemReq.Fields = "num_iid,title,nick,pic_url,cid,price,type,delist_time,post_fee";
        //itemReq.Q = "N97";
        //ItemsGetResponse itemRsp = myclient.Execute(itemReq);

        UserGetRequest req = new UserGetRequest(); //实例化具体API对应的Request类 
        req.Fields = "user_id,nick,created,buyer_credit,type,sex";
        req.Nick = "sandbox_c_1";
        UserGetResponse rsp = myclient.Execute(req);//执行API请求并将该类转换为response对象 

    }
}